public class Test {
    public static void main(String[] args) {
        String s1 = new String("Hello World！");
        String s2 = new String("Hello World！");
        boolean equals = s1.equals(s2);// true
        boolean r = s1 == s2;// flase
        int rr = s1.compareTo(s2);

        String s3 = "Hello World！"; // 存储于常量池，可共享的空间
        String s4 = "Hello World！"; // 存储于常量池
        equals = s3.equals(s4);// true
        r = s3 == s4;// true







       /* int x = 0, y = 1, z = 2;
        String s = "x, y, z";
        System.out.println(s + x + y + z); // ？
        System.out.println(x + y + z + s); // ？




        double r = Math.random();
        System.out.println(r);

        // 存储于栈中，简单的存储字符1的存储单元
        char c1 = '1';
        // c2是存储于栈中的一个引用(指针变量)，指向堆中的对象空间
        Character c2 = new Character('1');
        if ((c1 >= 'a' && c1 <= 'z') || (c1 >= 'A' && c1 <= 'Z')) {
            System.out.println("c1是字母");
        }
        if (Character.isLetter(c1)) {
            System.out.println("c1是字母");
        }
        String str = new String("    Java World    ");
        String upperCase = str.toUpperCase();
        String lowerCase = str.toLowerCase();
//        String s = str.trim();
        int length = str.length();

*/
    }
}
